<%@page pageEncoding="utf-8" contentType="text/html;charset=utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="/easybuy/css/style.css" />
<!--[if IE 6]>
    <script src="/easybuy/js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
<script type="text/javascript"
	src="/easybuy/js/jquery-1.11.1.min_044d0927.js"></script>
<script type="text/javascript"
	src="/easybuy/js/jquery.bxslider_e88acd1b.js"></script>

<script type="text/javascript" src="/easybuy/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="/easybuy/js/menu.js"></script>

<script type="text/javascript" src="/easybuy/js/select.js"></script>

<script type="text/javascript" src="/easybuy/js/lrscroll.js"></script>

<script type="text/javascript" src="/easybuy/js/iban.js"></script>
<script type="text/javascript" src="/easybuy/js/fban.js"></script>
<script type="text/javascript" src="/easybuy/js/f_ban.js"></script>
<script type="text/javascript" src="/easybuy/js/mban.js"></script>
<script type="text/javascript" src="/easybuy/js/bban.js"></script>
<script type="text/javascript" src="/easybuy/js/hban.js"></script>
<script type="text/javascript" src="/easybuy/js/tban.js"></script>

<script type="text/javascript" src="/easybuy/js/lrscroll_1.js"></script>
<script>   	
		var flag=true;
		var isError=false;
    $(function(){
			$(window).load(function(){
				$("#ma").val("");
				$("#loginName").val("");
				$("#pwd").val("");
				$("#repwd").val("");
				$("#userName").val("");
				$("#identityCode").val("");
				$("#email").val("");
				$("#mobile").val("");
				$("#code").attr("src","validate");
			})
    		$("#loginName").attr({"required":"","placeholder":"由字母、数字、下划线组成,长度为6-16位","pattern":"[a-zA-Z][a-zA-Z_0-9]{5,15}"});
    		$("#pwd").attr({"required":"required","placeholder":"长度为6-16位","pattern":"[0-9A-Za-z+-\._?*]{6,16}"});
    		$("#userName").attr({"required":"required","placeholder":"","pattern":"([\u4e00-\u9fa5]{1,20}|[a-zA-Z\.\s]{1,20})"});	
			$("#identityCode").attr("pattern","[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$)|(^[1-9]\d{5}\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{2}[0-9Xx]");	
			$("#email").attr("pattern","[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}");	
			$("#mobile").attr("pattern","((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}");	
    		$("input[type='checkbox']").click(function(){
				check();
			})
			$("#submit").click(yan);
			$("#loginName").blur(a);
	});		
			function test(){
				var ma=$("#ma").val();
  					$.getJSON("/easybuy/validate","type=yan&ma="+ma,function(result){
  						if(result==false){
  							isError=false;
  							getCode();
  							$("#ma").val("");
  						} else {
  							isError=true;
  						}
  			 		})
			}
			function  getCode(){
  				$("#code").attr("src","");
  				$.get("/easybuy/validate","");
  				$("#code").attr("src","validate");	
  			}
			function a(){
					var loginName=$("#loginName").val();
					$.getJSON("/easybuy/UserServlet","opr=yan&loginName="+loginName,function(result){
					if(parseInt(result)>0){
						alert("该用户已被注册");
						flag=false;
					}  else {
						flag=true;
					}
				})
			}
			
			function yan(){
				var loginName=document.getElementById("loginName");
				if(loginName.validity.valueMissing==true){
    				loginName.setCustomValidity("登录用户名不能为空");
    			} else if(loginName.validity.patternMismatch==true){
    				loginName.setCustomValidity("登录用户名必须是由字母、数字、下划线组成,开头必须是字母,长度为6-16位");
    			}   else {
    				loginName.setCustomValidity("");
				}
					var pwd=document.getElementById("pwd");
    			if(pwd.validity.valueMissing==true){
    					pwd.setCustomValidity("密码不能为空");
    				} else if(pwd.validity.patternMismatch==true){
    					pwd.setCustomValidity("密码不能包含非法字符,可包含常用字符,长度为6-16位,区分大小写");
    				} else {
    					pwd.setCustomValidity("");
    				}
    				
    			var repwd=document.getElementById("repwd");
    			if(pwd.value!=repwd.value){
    				repwd.setCustomValidity("两次密码输入不一致!");
    			} else {
    				repwd.setCustomValidity("");
    			}
    			var userName=document.getElementById("userName");
    			if(userName.validity.valueMissing==true){
    					userName.setCustomValidity("真实姓名不能为空");
    				} else if(userName.validity.patternMismatch==true){
    					userName.setCustomValidity("请输入真实姓名");
    				} else {
    					userName.setCustomValidity("");
    				}
    			var identityCode=document.getElementById("identityCode");
    			if(identityCode.value!="" || identityCode.value!=null){
    				 if(identityCode.validity.patternMismatch==true){
    					identityCode.setCustomValidity("请输入正确的身份证号");
    				} else {
    					identityCode.setCustomValidity("");
    				}
    			}
    			var email=document.getElementById("email");
    			if(email.value!="" || email.value!=null){
    				 if(email.validity.patternMismatch==true){
    					email.setCustomValidity("请输入正确的邮箱地址");
    				} else {
    					email.setCustomValidity("");
    				}
    			}
    			var mobile=document.getElementById("mobile");
    			if(mobile.value!="" || mobile.value!=null){
    				 if(mobile.validity.patternMismatch==true){
    					mobile.setCustomValidity("请输入正确的手机号");
    				} else {
    					mobile.setCustomValidity("");
    				}
    			}
					}
		function  check(){
				var isOver=true;
				if(flag==false){
					alert("该用户已被注册");
					return false;
				}
				var ma=$("#ma").val();
				$.ajax({
					"url":"/easybuy/validate",
					"type":"GET",
					"data":"type=yan&ma="+ma,
					"dataType":"JSON",
					"async":false,
					"success":function(result){
  						if(result==false){
  							isError=false;
  							getCode();
  							$("#ma").val("");
  						} else {
  							isError=true;
  						}
  					}
  			 	})
					if(isError==false){
						getCode();
						return false;
					}
					if($("input[type='checkbox']").is(':checked')==false){
    					$("#ti").text("请接受服务条款!");
    					return  false;
    				} else {
    			 		$("#ti").text("");
    			 		return true;
    				}
				
		}
    </script>

<title>尤洪</title>
</head>
<body>
	<!--Begin Header Begin-->
	<div class="soubg">
		<div class="sou">
			<span class="fr"> <span class="fl">你好，请<a
					href="Login.jsp">登录</a>&nbsp; <a href="Regist.jsp"
					style="color:#ff4e00;">免费注册</a>&nbsp; </span> <span class="fl">|&nbsp;关注我们：</span>
				<span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#"
					class="sh2">微信</a> </span> <span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img
						src="images/s_tel.png" align="absmiddle" /> </a> </span> </span>
		</div>
	</div>
	<!--End Header End-->
	<!--Begin Login Begin-->
	<div class="log_bg">
		<div class="top">
			<div class="logo">
				<a href="Index.jsp"><img src="images/logo.png" /> </a>
			</div>
		</div>
		<div class="regist">
			<div class="log_img">
				<img src="images/l_img.png" width="611" height="425" />
			</div>
			<div class="reg_c">
				<form method="post" onsubmit="return check()"
					action="/easybuy/UserServlet?opr=regist">
					<table border="0"
						style="width:420px; font-size:14px; margin-top:20px;"
						cellspacing="0" cellpadding="0">
						<tr height="50" valign="top">
							<td width="95">&nbsp;</td>
							<td><span class="fl" style="font-size:24px;">注册</span> <span
								class="fr">已有商城账号，<a href="Login.jsp"
									style="color:#ff4e00;">我要登录</a> </span></td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;登录用户名
								&nbsp;</td>
							<td><input type="text" value="" autocomplete="off" name="loginName"
								class="l_user" id="loginName" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;密码
								&nbsp;</td>
							<td><input type="password" value="" name="pwd" class="l_pwd"
								id="pwd" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;确认密码
								&nbsp;</td>
							<td><input type="password" value="" class="l_pwd" id="repwd" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>真实姓名 &nbsp;</td>
							<td><input type="text" value="" autocomplete="off" class="l_user" id="userName"
								name="userName" />
							</td>
						</tr>
						<tr height="50">
							<td align="right">性别 &nbsp;</td>
							<td><input type="radio" name="sex" value="1" id="men"
								checked /><label for="men">&nbsp;男&nbsp;</label> <input
								type="radio" name="sex" value="0" id="women" /><label
								for="women">&nbsp;女&nbsp;</label>
						</tr>
						<tr height="50">
							<td align="right">&nbsp;身份证号&nbsp;</td>
							<td><input type="text" value="" id="identityCode"
								name="identityCode" autocomplete="off" class="l_user" />
							</td>
						</tr>
						<tr height="50">
							<td align="right">&nbsp;邮箱 &nbsp;</td>
							<td><input type="text" autocomplete="off" value="" name="email" id="email"
								class="l_email" />
							</td>
						</tr>
						<tr height="50">
							<td align="right">&nbsp;手机 &nbsp;</td>
							<td><input type="text" autocomplete="off" value="" id="mobile" name="mobile"
								class="l_tel" />
							</td>
						</tr>
						<tr height="50">
							<td align="right"><font color="#ff4e00">*</font>&nbsp;验证码
								&nbsp;</td>
							<td><input type="text" autocomplete="off" value="" class="l_ipt" id="ma" /> <img
								src="" id="code" onclick="getCode()" /></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td style="font-size:12px; padding-top:20px;"><span
								style="font-family:'宋体';" class="fl"> <label
									class="r_rad"><input type="checkbox" checked /> </label><label
									class="r_txt">我已阅读并接受《用户协议》</label><label id="ti"
									style="color:red;padding:3px"></label> </span></td>
						</tr>
						<tr height="60">
							<td>&nbsp;</td>
							<td><input type="submit" id="submit" value="立即注册"
								class="log_btn" />
							</td>
						</tr>
					</table>
				</form>
			</div>
		</div>
	</div>
	<!--End Login End-->
	<!--Begin Footer Begin-->
	<div class="btmbg">
		<div class="btm">
			备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com Copyright © 2015-2018
			尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
			<img src="images/b_1.gif" width="98" height="33" /><img
				src="images/b_2.gif" width="98" height="33" /><img
				src="images/b_3.gif" width="98" height="33" /><img
				src="images/b_4.gif" width="98" height="33" /><img
				src="images/b_5.gif" width="98" height="33" /><img
				src="images/b_6.gif" width="98" height="33" />
		</div>
	</div>
	<!--End Footer End -->

</body>


<!--[if IE 6]>
<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>
